package com.bitc.crash.model.request;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * 创建订单请求
 */
@Data
@Schema(description = "创建订单请求")
public class CreateOrderRequest implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "用户手机号")
    private String userPhone;

    @Schema(description = "订单商品列表")
    @NotEmpty(message = "订单商品列表不能为空")
    private List<OrderItemRequest> orderItems;

    @Schema(description = "支付方式：1-现金，2-微信，3-支付宝")
    @NotNull(message = "支付方式不能为空")
    private Integer paymentMethod;

    @Schema(description = "订单备注")
    private String remark;

    /**
     * 订单商品项
     */
    @Data
    @Schema(description = "订单商品项")
    public static class OrderItemRequest implements Serializable {

        private static final long serialVersionUID = 1L;

        @Schema(description = "商品ID")
        @NotNull(message = "商品ID不能为空")
        private Long commodityId;

        @Schema(description = "商品名称")
        private String commodityName;

        @Schema(description = "购买数量")
        @NotNull(message = "购买数量不能为空")
        private Integer quantity;

        @Schema(description = "选择的规格JSON")
        private String specifications;

        @Schema(description = "选择的加料JSON")
        private String additions;

        @Schema(description = "商品备注")
        private String remark;
    }
} 